home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / gnulib / fchart / fchart.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-05  |  4.0 KB  |  160 lines

  1. /* Fchart - fchart.h 
  2.  *
  3.  * Copyright (C) 1990 Piotr Filip Sawicki
  4.  *
  5.  * Permission to use, copy, and distribute this software and its
  6.  * documentation for any purpose with or without fee is hereby granted,
  7.  * provided that the above copyright notice appear in all copies and
  8.  * that both that copyright notice and this permission notice appear
  9.  * in supporting documentation.
  10.  *
  11.  * Permission to modify the software is granted, but not the right to
  12.  * distribute the modified code.  Modifications are to be distributed
  13.  * as patches to released version.
  14.  *
  15.  * This software  is provided "as is" without express or implied warranty.
  16.  *
  17.  * send your comments or suggestions to fs@uwasa.fi
  18.  *
  19.  */
  20.  
  21. #ifdef PROGRAM
  22. #undef PROGRAM
  23. #endif
  24. #ifdef PROMPT
  25. #undef PROMPT
  26. #endif
  27. #ifdef HELP
  28. #undef HELP
  29. #endif
  30.  
  31. #define PROGRAM "FCHART"
  32. #define PROMPT "command> "
  33. #define EXP_PROMPT "cont: "
  34.  
  35. #ifdef vms
  36. #define HELP  "fchart "
  37. #else /* vms */
  38. #define HELP  "/usr/local/bin/help fchart"
  39. #endif /* vms */
  40.  
  41. #ifdef TERM
  42. #undef TERM
  43. #endif
  44.  
  45. #ifdef PC
  46. #define TERM "egalib"
  47. #else
  48. #ifdef UNIXPC
  49. #define TERM "unixpc"
  50. #else
  51. #define TERM "tek40xx"        /* put your most common term type here! */    
  52. #endif 
  53. #endif
  54.  
  55. enum DRAW_STYLE {
  56.     SBAR, ABARS, LAYB, PIECHART
  57. };
  58.  
  59. enum GRAV_DIR {
  60.     NORTH=0, WEST=1, SOUTH=2, EAST=3, DEFAULT   /* for exploding parts of piechart only */
  61. };
  62.  
  63. enum INP_STYLE {
  64.     GNUPLOT, PRIVATE, CUSTOMD
  65. };
  66.  
  67. enum FONT_STYLE {
  68.     F_NEVER=0, F_WHENN=1, F_ROTAT=2, F_ALWYS=3
  69. };
  70.  
  71. #define HL_MIN -3
  72. #define HL_MAX -2
  73. #define HL_NON -1
  74. extern int HLitem;
  75.  
  76. struct pair {
  77.     int from, upto;
  78. };    
  79.  
  80. #ifdef PC
  81. typedef float vreal;        /* "virtual" real */
  82. #define CH_INIT_SIZE 50        /* initial size of data chunk */
  83.  
  84. #else
  85. typedef double vreal;
  86. #define CH_INIT_SIZE 200
  87.  
  88. #endif
  89.  
  90. struct chunk {            /* chunk of data */
  91.     vreal *dval;        /* array of values */
  92.     char **vlbl;        /* array of labels */
  93.     int    used;        /* number of used elements */
  94.     struct chunk *next;    /* next chunk */
  95. };
  96.  
  97. struct dfile {                /* NORMAL FILE record */            /* DATA_HEAD */
  98.     char *fname;            /* name of data file */                /* title of the picture */
  99.     vreal d_min, d_max;        /* min & max data value */            /* min & max of all values */
  100.     int  points, chunks;    /* number of points and chunks */    /* total num. of points and files */
  101.     int  makeHL;            /* item to highlit */                /* global HL request */
  102.     BOOLEAN labels;            /* can we generate labels? */        /* global autolabel request */ 
  103.     struct chunk *data;        /* head of chunk list */            /* used for indexes when xploting */
  104.     struct dfile *dnxt;        /* next data file */                /* begining of file list */
  105. };
  106.  
  107. struct xptr {                /* structure for cross ploting thru several data files */
  108.     struct chunk *chnp;        /* pointer to current chunk */
  109.     int vindex;                /* index to current element in it */
  110. };
  111.  
  112. #ifdef NO_ROMAN_FONT
  113. struct Char {
  114.     int wid;
  115.     unsigned char *def[3];
  116. };
  117. #define CHAR_OFF 100
  118. #define CHAR_GRD 256
  119. #else
  120. struct Char {
  121.     int wid;
  122.     int *def;
  123. };
  124. #define CHAR_OFF 10
  125. #define CHAR_GRD 80
  126. #endif
  127.  
  128. typedef double MATRIX[3][3];
  129.  
  130. extern BOOLEAN interactive;
  131.  
  132. enum LAB_ROT {                    /* order sagnificant */
  133.     L_NORMAL, L_BOTTOM, L_UPSIDE, L_TOP, L_RANDOM
  134. };
  135.  
  136. struct label_def {
  137.     struct label_def *next;    /* pointer to next label in linked list */
  138.     int tag;                    /* identifies the label */
  139.     double x,y;                    /* position ... */
  140.     BOOLEAN paged;                /* on page or picture */
  141.     enum JUSTIFY pos;
  142.     char text[MAX_LINE_LEN+1];
  143.     enum LAB_ROT rot;
  144.     double h, w, a;                /* height, width, angle */
  145. };
  146.  
  147. #define RESOLUTION 100000        /* ideal resolution for labels */
  148.  
  149. struct linearrow_def {
  150.     struct linearrow_def *next; /* pointer to next arrow in linked list */
  151.     BOOLEAN arrow;                /* arrow or line */
  152.     int tag;                    /* identifies the arrow */
  153.     double sx,sy;               /* start position ... */
  154.     BOOLEAN startp;                /* ... on page ? */
  155.     double ex,ey;                  /* end position ... */
  156.     BOOLEAN endp;                /* ... on page ? */
  157. };
  158.  
  159.  
  160.